package com.nbsaas.boot.no.rest.resource;

import com.nbsaas.boot.no.api.apis.NoSequenceApi;
import com.nbsaas.boot.no.data.entity.NoSequence;
import com.nbsaas.boot.no.api.domain.request.NoSequenceRequest;
import com.nbsaas.boot.no.api.domain.response.NoSequenceResponse;
import com.nbsaas.boot.no.api.domain.simple.NoSequenceSimple;
import com.nbsaas.boot.no.rest.convert.NoSequenceSimpleConvert;
import com.nbsaas.boot.no.rest.convert.NoSequenceEntityConvert;
import com.nbsaas.boot.no.rest.convert.NoSequenceResponseConvert;
import com.nbsaas.boot.no.data.repository.NoSequenceRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   订单-业务接口实现
*/
@Transactional
@Service
public class NoSequenceResource extends BaseResource<NoSequence,NoSequenceResponse, NoSequenceSimple, NoSequenceRequest>  implements NoSequenceApi {

    @Resource
    private NoSequenceRepository noSequenceRepository;

    @Override
    public JpaRepositoryImplementation<NoSequence, Serializable> getJpaRepository() {
        return noSequenceRepository;
    }

    @Override
    public Function<NoSequence, NoSequenceSimple> getConvertSimple() {
        return new NoSequenceSimpleConvert();
    }

    @Override
    public Function<NoSequenceRequest, NoSequence> getConvertForm() {
        return new NoSequenceEntityConvert();
    }

    @Override
    public Function<NoSequence, NoSequenceResponse> getConvertResponse() {
        return new NoSequenceResponseConvert();
    }




}


